<script>
	$(function(){
		$("#shop_id").combobox({    
		    url: '/shop/combobox',    
		    required: true,
		    valueField:'id',    
    		textField:'name', 
		    width:150
		}); 
		
		$("#unit_id").combotree({    
		    url: '/shopGoods/combotree',  
		    multiple:true,
	    	editable:false,
		    width:400
		});
		
		$("#form_goods").datagrid({
			title:'商品列表',
			url:'/goods/grid', 
			columns:[[    
		        {field:'id',title:'编号',width:100,checkbox:true,},
		        {field:'categoryName',title:'类别',width:120},
		        {field:'name',title:'商品名称',width:120},
		        //{field:'price',title:'商品价格',width:60},
		        {field:'icon',title:'商品图片URL',width:300}
		    ]],
		    toolbar : [],
		    pagination:true,
		    onCheck:function(rowIndex, rowData){
		    	var goodsId = $("#goods_id").val();
		    	goodsId += goodsId==""?rowData.id: ("," + rowData.id);
		    	$("#goods_id").val(goodsId);
		    }
		});
	});

</script>
<form method="post" id="editForm" name="editForm">
	<input type="hidden" name="shopGoods.id" value="${(po.id)!}" id="poid">
	<div id="tt" class="easyui-tabs" style="width: 786px; height: 450px;">
		<div title="商户商品信息" style="padding: 5px;">
			<table class="tableForm tableCss">
				<tr>
					<th>商户</th>
					<td colspan="3">
						<input type="hidden" id="goods_id" name="goods_id">
						<input id="shop_id" name="shop_id"> 
					</td>
				</tr>
				<tr>
					<th>单位</th>
					<td colspan="3">
						<input id="unit_id" name="unitIds" value="1" data-options="required:true"/>（可多选）
					</td>
				</tr>
			</table>
			<table id="form_goods"></table>
		</div>
	</div>
</form>